home *** CD-ROM | disk | FTP | other *** search
- 90 f=(1=1)
- 100 gosub 2250
- 110 data jan,feb,mar,apr,may,jun
- 120 data jul,aug,sep,oct,nov,dec
- 130 data sunday,monday,tuesday,wednesday
- 140 data thursday,friday,saturday
- 150 dim m$(12),w$(6),l$(100)
- 160 for j=1 to 12
- 170 read m$(j)
- 180 next j
- 190 for j=0 to 6
- 200 read w$(j)
- 210 next j
- 220 print "event calendar"
- 230 if f=0 then 260
- 240 c=1
- 250 gosub 3010
- 255 if e=0 then 260
- 256 f=0
- 260 print "today's date:"
- 270 y8=y9
- 280 gosub 1670
- 290 m8=m
- 300 d8=d
- 310 if m8>=m9 then 330
- 320 y8=y9+1
- 330 if m8<>m9 or d8>=d9 then 350
- 340 y8=y9+1
- 350 if y8<=y9 then 370
- 360 print "happy new year"
- 370 if f then 400
- 380 print "year";
- 390 input y8
- 400 d9$=right$(str$(100+m9),2)+"/"
- 410 d9$=d9$+right$(str$(100+d9),2)
- 420 if f then 440
- 430 d9$=d8$
- 440 f=(1=1)
- 450 gosub 1960
- 460 print "past events: ";
- 470 if l0>=0 then 500
- 480 print "none"
- 490 goto 650
- 500 print l0+1
- 510 gosub 4010
- 520 f9=-1
- 530 for j=0 to l0
- 540 if mid$(l$(j),6,1)="/" then 570
- 550 l$(l9)=l$(j)
- 560 l9=l9+1
- 570 next j
- 580 l8=l0+1
- 590 for j=l8 to l9-1
- 600 l$(j-l8)=l$(j)
- 610 next j
- 620 l9=l9-l8
- 630 l8=0
- 640 l=l9
- 650 f=0
- 660 f9=0
- 670 d9$=d8$
- 680 l=l9-l8
- 690 if l<>0 then 710
- 700 print "no future events"
- 710 if l=0 then 730
- 720 print l;" future events"
- 730 print
- 740 print "1. see future events"
- 750 print "2. add new event"
- 760 print "3. cancel event"
- 770 print "4. search for event"
- 780 print "5. quit"
- 790 print
- 800 print "...your choice (1-5)";
- 810 input a
- 820 print
- 830 on a goto 850,940,1210,1450,1570
- 840 goto 730
- 850 print "ahead to date:"
- 860 gosub 1670
- 870 gosub 1960
- 880 if l0<>-1 then 910
- 890 print "no events"
- 900 goto 920
- 910 gosub 4010
- 920 print l9-l0-1;" other future events"
- 930 goto 730
- 940 print "annual or one-time (a/o)"
- 950 input p$
- 960 a=0
- 970 p$=left$(p$,1)
- 980 if p$="o" then 1010
- 990 a=1
- 1000 if p$<>"a" then 730
- 1010 gosub 1670
- 1020 y$="/"+right$(str$(101+y8),2)
- 1030 if d8$<=d9$ then 1050
- 1040 y$="/"+right$(str$(100+y8),2)
- 1050 if a<>1 then 1070
- 1060 y$=""
- 1070 gosub 1960
- 1080 if l9-1<l0+1 then 1120
- 1090 for j=l9-1 to l0+1 step -1
- 1100 l$(j+1)=l$(j)
- 1110 next j
- 1120 print "detail";
- 1130 input ll$
- 1140 d8$=d8$+y$
- 1150 d8$=d8$+" "
- 1160 l$(l0+1)=d8$+ll$
- 1170 l9=l9+1
- 1180 l=l9
- 1190 f9=-1
- 1200 goto 680
- 1210 print "change which date:"
- 1220 gosub 1670
- 1230 l0=-1
- 1240 for j=l8 to l9-1
- 1250 if d8$<>left$(l$(j),5) then 1300
- 1260 l1=j
- 1270 if l0<>-1 then 1290
- 1280 l0=j
- 1290 print j;": ";l$(j)
- 1300 next j
- 1310 if l0<>-1 then 1340
- 1320 print "no events"
- 1330 goto 730
- 1340 print
- 1350 print " delete which event above";
- 1360 input a
- 1370 if a<l0 or a>l1 then 730
- 1380 for j=a to l9-1
- 1390 l$(j)=l$(j+1)
- 1400 next j
- 1410 l9=l9-1
- 1420 f9=-1
- 1430 print " ... deleted"
- 1440 goto 680
- 1450 print "search for";
- 1460 input p$
- 1470 p=len(p$)
- 1480 for j=0 to l9-1
- 1490 a=7
- 1500 if mid$(l$(j),6,1)<>"/" then 1520
- 1510 a=10
- 1520 if a+p-1>len(l$(j)) or p$<>mid$(l$(j),a,p) then 1540
- 1530 print l$(j)
- 1540 next j
- 1550 print " end of search"
- 1560 goto 730
- 1570 if f9<>0 then 1590
- 1575 ifothenclose15
- 1580 end
- 1590 print "ready to write new events file (y/n)"
- 1600 input p$
- 1610 if left$(p$,1)="y" then 1630
- 1620 stop
- 1630 d9$=d9$+"/"
- 1640 d9$=d9$+right$(str$(y8+100),2)
- 1650 c=2
- 1660 goto 3010
- 1670 m=0
- 1680 print "month";
- 1690 input mm$
- 1700 m=val(mm$)
- 1710 mm$=left$(mm$+"xx",3)
- 1720 if m=0 then 1760
- 1730 if m<1 or m>12 then 1670
- 1740 print m$(m)
- 1750 goto 1810
- 1760 for j=1 to 12
- 1770 if mm$<>m$(j) then 1790
- 1780 m=j
- 1790 next j
- 1800 if m<1 or m>12 then 1670
- 1810 print "day";
- 1820 input d
- 1830 if d<1 or d>31 then 1670
- 1840 d8$=right$(str$(100+m),2)+"/"
- 1850 d8$=d8$+right$(str$(100+d),2)
- 1860 y=y8
- 1870 if d8$>d9$ then 1890
- 1880 y=y8+1
- 1890 gosub 2150
- 1900 if len(ll$)<=0 then 1920
- 1910 print "(";w$(w);")"
- 1920 return
- 1930 c=1
- 1940 gosub 3010
- 1950 return
- 1960 ll$=chr$(255)
- 1970 l0=-1
- 1980 if l<>0 then 2000
- 1990 return
- 2000 v$=d8$+ll$
- 2010 ww$=d9$
- 2020 if f<>0 then 2040
- 2030 ww$=d9$+ll$
- 2040 f1=(ww$>=v$)
- 2050 for j=l8 to l9-1
- 2060 f2=(l$(j)>ww$)
- 2070 f3=(v$>l$(j))
- 2080 f0=f2 and f3
- 2090 if f1=0 then 2110
- 2100 f0=f2 or f3
- 2110 if f0=0 then 2130
- 2120 l0=j
- 2130 next j
- 2140 return
- 2150 if y>=85 then 2170
- 2160 y=y+100
- 2170 m1=m+1
- 2180 m2=int(1/m1+.7)
- 2190 m3=y-m2
- 2200 m4=m1+12*m2
- 2210 n=int(m4*30.6001)+int(m3*365.25)+d
- 2220 m6=int(n/7)
- 2230 w=n-7*m6
- 2240 return
- 2250 print chr$(147)chr$(5)
- 2260 return
- 3000 rem input/output routine
- 3010 f$="events"
- 3020 print"disk or cassette (d/c)?"
- 3030 geta$:if((a$<>"c")and(a$<>"d"))ora$=""then3030
- 3040 ifa$="d"then3060
- 3050 d1=0:g$="":goto3070
- 3060 f$="@0:"+f$:d1=1
- 3070 ifc=2then3160
- 3080 ifd1=1theng$=",s,r"
- 3090 open1,1+7*d1,8*d1,f$+g$:gosub3220:ifethenclose1:goto3150
- 3100 input#1,ll$:if len(ll$)<>8 then print ll$;"?":goto 3140
- 3110 m=val(left$(ll$,2)):d=val(mid$(ll$,4,2)):y0=val(mid$(ll$,7,2))
- 3120 m9=m:d9=d:y9=y0:l=0:print "last access: ";ll$
- 3130 input#1,l$(l):l=l+1:if st=0 then 3130
- 3140 close1:gosub3220
- 3150 l8=0:l9=l:return
- 3160 ifd1=1theng$=",s,w"
- 3170 open1,1+7*d1,1+7*d1,f$+g$:gosub3220:ifethenclose1:close15:end
- 3180 print#1,d9$;chr$(13);
- 3190 forj=0tol9-1:print#1,l$(j);chr$(13);:nextj
- 3200 gosub3220:close1:gosub3220:ifothenclose15
- 3210 end
- 3220 ifd1=0thenreturn
- 3230 ifo=0thenopen15,8,15:o=1
- 3240 input#15,e,b$:ifethenprintb$:close15:o=0
- 3250 return
- 4000 rem print routine
- 4010 d$="":p=3
- 4020 input "want events on printer (y/n)";p$
- 4030 if left$(p$,1)<>"y" then 4050
- 4040 p=4
- 4050 open 3,p
- 4060 for j=l8 to l0
- 4070 if d$=left$(l$(j),5) then 4150
- 4080 d$=left$(l$(j),5)
- 4090 m=val(left$(d$,2))
- 4100 d=val(mid$(d$,4,2))
- 4110 y=y8:if d$<=d9$ then y=y8+1
- 4120 gosub 2150
- 4130 print#3,w$(w);" ";
- 4140 print#3,m$(m);d
- 4150 print#3," ";mid$(l$(j),6)
- 4160 next j
- 4170 close 3
- 4180 return
-